package com.binvshe.binvshe.common.huanxin_im;

import android.content.Context;
import android.content.Intent;

import com.hyphenate.easeui.EaseConstant;
import com.hyphenate.easeui.model.dao.UserIconHelper;

/**
 *  聊天辅助类
 *
 * @Author: PV
 * @E-mail: pengveivei@sina.cn
 * @CreateDate: 2016/9/22 21:28
 * @Version: 1.0.0
 */
public class ChatHelper {

    public static final void startSingleChat(Context context, String usrname) {
        Intent intent = new Intent(context, ChatActivity.class);
        intent.putExtra(EaseConstant.EXTRA_USER_ID, usrname);
        context.startActivity(intent);

    }

    public static final void startSingleChat(Context context, String usrname, String nickName, String portrait) {
        UserIconHelper.setUserIcon(context, usrname, nickName, portrait);
        Intent intent = new Intent(context, ChatActivity.class);
        intent.putExtra(EaseConstant.EXTRA_USER_ID, usrname);
        context.startActivity(intent);

    }


    public static final void startGroupChat(Context context, String groupId, String nickName, String portrait) {
        UserIconHelper.setUserIcon(context, groupId, nickName, portrait);
        Intent intent = new Intent(context, ChatActivity.class);
        intent.putExtra(EaseConstant.EXTRA_USER_ID, groupId);
        intent.putExtra(EaseConstant.EXTRA_CHAT_TYPE, EaseConstant.CHATTYPE_GROUP);
        context.startActivity(intent);

    }

    public static final void startGroupChat(Context context, String groupId) {
        Intent intent = new Intent(context, ChatActivity.class);
        intent.putExtra(EaseConstant.EXTRA_USER_ID, groupId);
        intent.putExtra(EaseConstant.EXTRA_CHAT_TYPE, EaseConstant.CHATTYPE_GROUP);
        context.startActivity(intent);

    }
}
